/*
信用量管理

*/
import httpRequest from '@/utils/httpRequest'
// 获取信用量列表
export function getList (data) {
  return httpRequest({
    url: '/basis/sales/companyProductCredit/list',
    method: 'get',
    params: data
  })
}

// 获取信用量执行明细列表
export function getDoList (data) {
    return httpRequest({
        url: '/basis/sales/companyProductCredit/doList',
        method: 'get',
        params: data
    })
}

// 新增or修改额度
export function edit (data) {
  return httpRequest({
    url: '/basis/sales/companyProductCredit',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}
// 根据客户id查询收货地址列表

export function getCompanyArea (data) {
  return httpRequest({
    url: '/basis/sales/companyAddress/list',
    method: 'get',
    params: data
  })
}

// 新增或修改客户收货地址
export function editCompanyArea (data) {
  return httpRequest({
    url: '/basis/sales/companyAddress',
    method: 'post',
    headers: {'Content-Type': 'application/json; charset=utf-8'},
    data: data
  })
}
// 修改客户状态
export function editState (data) {
  return httpRequest({
    url: '/basis/sales/companyProductCredit/updateStatus',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}
// 删除收货地址
export function deleteAddress (data) {
  return httpRequest({
    url: '/basis/sales/companyAddress/delete',
    method: 'post',
    data: data,
    headers: {'Content-Type': 'application/json; charset=utf-8'}
  })
}

// 删除客户
export function delCrm (data) {
  return httpRequest({
    url: '/basis/sales/companyProductCredit/delete',
    method: 'post',
    data: data
  })
}

// 信用量管理：根据分类id获取商品右侧列表
export function productList (data) {
  return httpRequest({
    url: '/basis/sales/companyProductCredit/productList',
    method: 'get',
    params: data
  })
}

// 信用量管理：根据id获取信用量详情
export function getCreditInfo (data) {
  return httpRequest({
    url: '/basis/sales/companyProductCredit',
    method: 'get',
    params: data
  })
}

// 校验：同一客户、同一产品存在历史数据，需询问客户
export function isCheck (data) {
  return httpRequest({
    url: '/basis/sales/companyProductCredit/isCheck',
    method: 'get',
    params: data
  })
}
